<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>广东恒峰信息技术有限公司-数字校园云数据中心平台</title>
    <script src="static/js-lib/bootstrap/js/jquery.js"></script>
    <script src="static/js-lib/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="static/js-lib/bootstrap/css/bootstrap.min.css">
    <script>
     //location.href="/views/login.html";
    </script>
    <style>
        #contentDiv{
            width:980px;
            height:200px;
            marin:0px auto;
        }
        ul{
            padding: 0px;
            margin: 0px;
        }
        #titleul li{
            float:left;
            height:30px;
            width:200px;
            line-height: 30px;
            list-style: none;
        }
    </style>
</head>
<body>
<div>
    <nav class="navbar navbar-inverse" style="border-radius:0">
        <div class="container">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">
                    <img id="brandImg" alt="Brand" src="static/img/data-center.png">
                </a>
            </div>
        </div>
    </nav>


        <iframe id="iframe" src="about:blank" style="display:none"></iframe>

        <div style="margin-top: 10%"></div>
        <div class="row">
            <div class="col-md-offset-4 col-md-5">
                <div class="panel panel-info">
                    <div class="panel-heading"><strong>Digital Cawpus Cloud Data Center Platform</strong></div>
                    <div class="panel-body">
                        <form class="form-horizontal" action="" method="post">
                            <div class="form-group">
                                <div class="col-sm-12"></div>
                            </div>
                            <div id="testDiv">

                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-3 control-label">用户名：</label>
                                <div class="col-sm-9">
                                    <input class="form-control" name="username" id="inputEmail3" placeholder="请求输入您的用户名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-3 control-label">密码：</label>
                                <div class="col-sm-9">
                                    <input type="password" name="password" class="form-control" id="inputPassword3" placeholder="请输入您的密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-3 col-sm-3">
                                    <button type="submit" class="btn btn-info"> 登 陆 </button>
                                </div>
                                <a href="http://192.168.13.233/survey/qnaire/27/exportPdf?htmlPath=http://192.168.13.233:8080&qnaireId=27">导出到pdf</a>
                                <div class="col-sm-6">
                                    <p class="form-control-static hidden" id="message" style="color: red"></p>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <nav class="navbar navbar-default navbar-fixed-bottom">
        <div class="container">
            <div class="row">
                <div class="col-md-5 col-md-offset-5"><p class="navbar-text"><em>广东恒丰信息技术有限公司</em></p></div>
            </div>
        </div>
    </nav>
</div>
</body>
<script>
    $(function () {



        var projectName = "";

        //文本框获得焦点时去掉后台反馈的消息提示
        $("input").focus(function () {
            $("#message").addClass("hidden");
        });

        //表单提交
        $("form").submit(function (e) {
            var form = $(this);
            e.preventDefault();//阻止表单默认提交
            //与后台交互
            $.ajax({
                url:projectName+"/login",
                type:"post",
                data:form.serialize(),
                success:function (resultData) {
                    console.info(resultData);
                    if(resultData.resultCode === "SUCCESS"){

                        location.href = projectName + "/sys/attach/index";

                    }else{
                        $("#message").removeClass("hidden").text(resultData.message);
                    }
                },
                dataType:"json"
            });

        });

    });
</script>
</html>